<?php
require_once("Tpl/header.html");
?>
        <div id="main">
            <div class="header">
                <h1>Problem</h1>
            </div>
            <div class="content">
                <div class="table-responsive">
                    <table class="pure-table pure-table-horizontal">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>ProblemID</th>
                                <th>Course Name</th>
                                <!-- <th>Teacher</th> -->
                                <th>Dead Line</th>
                                <th>Submit Statu</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                                foreach ($ProblemList as $key => $problem) {
                                    echo "<tr>";
                                    echo "<td>".($key+1)."</td>";

                                    echo "<td><a href=\"/index.php/Problem/detail?pid=".$problem["ProId"]."\">".$problem["ProId"]."</a></td>";
                                    echo "<td><a href=\"/index.php/Course/detail?cid=".$problem["SubId"]."\">".$problem["SubName"]."</a></td>";
                                    echo "<td>".$problem["problem.ProDate+problem.ProLength"]."</td>";
                                    if (isset($problem["max(answer.AnsTime)"]))
                                        echo "<td>".$problem["max(answer.AnsTime)"]."</td>";
                                    else
                                        echo "<td>no submit yet</td>";
                                    echo "</tr>";
                                }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
